<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
    <title>鸿蒙1期点名系统</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            -webkit-tap-highlight-color: transparent;
        }

        .container {
            background: rgba(255, 255, 255, 0.95);
            width: 90%;
            max-width: 500px;
            padding: 2rem;
            border-radius: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.15);
            backdrop-filter: blur(10px);
        }

        h1 {
            color: #2d3748;
            text-align: center;
            margin-bottom: 1.5rem;
            font-weight: 600;
            font-size: 1.8rem;
        }

        #nameDisplay {
            background: linear-gradient(45deg, #4a5568, #2d3748);
            color: white;
            font-size: 2.5rem;
            padding: 1.5rem;
            margin: 1.5rem 0;
            border-radius: 12px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            min-height: 120px;
            display: flex;
            justify-content: center;
            align-items: center;
            transition: transform 0.3s ease;
        }

        .controls {
            display: flex;
            justify-content: center;
            gap: 1rem;
        }

        button {
            padding: 1rem 2rem;
            font-size: 1.1rem;
            border: none;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-transform: uppercase;
            font-weight: 600;
            letter-spacing: 1px;
        }

        #startBtn {
            background: linear-gradient(45deg, #48bb78, #38a169);
            color: white;
            box-shadow: 0 4px 6px rgba(72, 187, 120, 0.2);
        }

        #startBtn:active {
            transform: scale(0.95);
            box-shadow: 0 2px 4px rgba(72, 187, 120, 0.2);
        }

        .pulse {
            animation: pulse 1.5s infinite;
        }

        @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
        }

        .flip {
            animation: flip 0.6s ease-out;
        }

        @keyframes flip {
            0% { transform: rotateX(0deg); }
            50% { transform: rotateX(180deg); }
            100% { transform: rotateX(360deg); }
        }

        @media (max-width: 480px) {
            #nameDisplay {
                font-size: 2rem;
                padding: 1rem;
            }
            button {
                padding: 0.8rem 1.5rem;
                font-size: 1rem;
            }
        }
    </style>
</head>
<body>
<div class="container">
    <h1>🎯 高级随机点名</h1>
    <div id="nameDisplay">READY</div>
    <div class="controls">
        <button id="startBtn" onclick="togglePick()">开始抽选</button>
    </div>
</div>

<script>
    const students = [
        ' 宋克强 ', ' 张昆明 ', ' 王国彤 ', ' 宦仁旭 ',
        ' 门博 ', ' 赵广 ', ' 朱伟豪 ', ' 齐洋洋 ',
        ' 王鑫 ', ' 谢世明 ', ' 张次恩 ', ' 霍文博 ',
        ' 戚倩倩 ', ' 王玉梁 ', ' 王东旭 ', ' 石俊巍 ',
        ' 张瑶 ', ' 赵艺繁 ', ' 胡圣群 ', ' 王臣洋 ',
        ' 周明宗 ', ' 王博萱 ', ' 信琪辉 ', ' 窦睿霖 ',
        ' 牟杭威 ', ' 刘瑞 ', ' 马毅隆 ', ' 杜云鹏 ',
        ' 齐腾达 ', ' 贾明辉 ', ' 魏子涵 ', ' 王朝锡 ',
        ' 周世纪 ', ' 郑再伟 ', ' 朱文博 ', ' 卢鹏宇 ',
        ' 王登博 ', ' 朱禹豪 ', ' 王展博 ', ' 杨阔 ',
        ' 马俊豪 ', ' 陈相伍 ', ' 赵明 ', ' 孙俊涛 ',
        ' 杨梦帆 ', ' 胡旭帆 ', ' 张振宇 ', ' 李培涵 ',
        ' 王成辉 ', ' 宋宜轩 ', ' 梁聪'
    ];

    let isPicking = false;
    let intervalId;
    const nameDisplay = document.getElementById('nameDisplay');
    const startBtn = document.getElementById('startBtn');

    function togglePick() {
        if (!isPicking) {
            // 开始抽选
            isPicking = true;
            startBtn.textContent = '停止抽选';
            nameDisplay.classList.add('pulse');

            intervalId = setInterval(() => {
                const randomIndex = Math.floor(Math.random() * students.length);
                nameDisplay.textContent = students[randomIndex];
                nameDisplay.classList.add('flip');
                setTimeout(() => nameDisplay.classList.remove('flip'), 600);
            }, 100);

        } else {
            // 停止抽选
            clearInterval(intervalId);
            isPicking = false;
            startBtn.textContent = '开始抽选';
            nameDisplay.classList.remove('pulse');
            nameDisplay.style.transform = 'scale(1)';
        }
    }

    // 触摸事件处理
    let touchTimer;
    startBtn.addEventListener('touchstart', function(e) {
        touchTimer = setTimeout(() => {
            togglePick();
        }, 100);
        e.preventDefault();
    });

    startBtn.addEventListener('touchend', function(e) {
        clearTimeout(touchTimer);
        e.preventDefault();
    });
</script>
</body>
</html>